package com.shtel.customerasset.controller;

import com.shtel.customerasset.entity.*;
import com.shtel.customerasset.mapper.QueryMapper;
import com.shtel.customerasset.service.CustomerassetService;
import com.shtel.customerasset.util.Cors;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Api(description = "资产信息服务接口")
@RestController
public class customerasssetController extends Cors {
    @Autowired
    CustomerassetService customerassetService;
    @Autowired
    QueryMapper queryMapper;

    //310320199506061234
    //查询在用套餐
    @ApiOperation(value = "查询在用套餐", notes = "查询在用套餐")
    @GetMapping("querytaocans/{creditnum}")
    public List<UsingTaocan> querytaocans(@PathVariable String creditnum) {

        return customerassetService.querytaocans(creditnum);

    }

    //查询在用产品
    @ApiOperation(value = "查询在用产品", notes = "查询在用产品")
    @GetMapping("querychanpings/{creditnum}")
    public List<UsingChanping> querychanpings(@PathVariable String creditnum) {
        return customerassetService.querychanpings(creditnum,1);
    }

    //查询在途套餐
    @ApiOperation(value = "查询在途套餐", notes = "查询在途套餐")
    @GetMapping("queryongoingtaocans/{creditnum}")
    public List<OnGoingTaoCan> queryongoingtaocans(@PathVariable String creditnum) {
        return customerassetService.queryongoingtaocans(creditnum);

    }

    //查询在途产品
    @ApiOperation(value = "查询在途产品", notes = "查询在途产品")
    @GetMapping("queryongoingchanpings/{creditnum}")
    public List<Chanping> queryongoingchanpings(@PathVariable String creditnum) {
        return customerassetService.queryongoingchanpings(creditnum);
    }


    //查询终端信息
    @ApiOperation(value = "查询终端信息", notes = "查询终端信息")
    @GetMapping("queryendduan/{creditnum}")
    public Endduan queryendduan(@PathVariable String creditnum) {

        return customerassetService.queryendduan(creditnum);

    }


}
